package router

import (
	"fmt"
	"git.mycaigou.com/gfyx/micro-gfyx-oppty-service/http_server/controller"
	"git.mycaigou.com/gfyx/micro-gfyx-oppty-service/http_server/controller/common"
	"git.mycaigou.com/gfyx/micro-gfyx-oppty-service/infrastructure/di"
	"github.com/gin-gonic/gin"
)

// RegisterHealthRouters 检测
func RegisterHealthRouters(g *gin.RouterGroup) {
	//new(controller.HealthController).RegisterRouter(g)
	c := di.InjectInstance()
	err := c.Invoke(func(
		healthController *controller.HealthController,
	) {
		healthController.RegisterRouter(g)
	})
	fmt.Printf("RegisterHealthRouters err: %+v\n", err)
}

func CommonRegisterRouters(g *gin.RouterGroup) {
	c := di.InjectInstance()
	err := c.Invoke(func(
		commonProfit *common.ProfitController) {
		commonProfit.RegisterRouter(g)
	})
	fmt.Printf("commonRegisterRouters err: %+v\n", err)
}
